import {
  shopGet,
  shopPost,
  shopPut,
  shopDelete,
  adGet,
  adPost,
  adPut,
  adDelete,
  categoryGet,
  categoryPost,
  categoryPut,
  categoryDelete,
  productGet,
  productPost,
  productPut,
  productDelete,
  orderGet,
  orderPut,
  orderStatusPut,
  orderPostnoPut,
  orderDelete
} from '@/api/shopApi'
const shop = {
  namespaced: true,
  state: {
  },
  getters: {},
  mutations: {
  },
  actions: {
    ShopGet ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        shopGet(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    ShopPost ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        shopPost(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    ShopPut ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        shopPut(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    ShopDelete ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        shopDelete(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    AdGet ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        adGet(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    AdPost ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        adPost(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    AdPut ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        adPut(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    AdDelete ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        adDelete(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    CategoryGet ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        categoryGet(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    CategoryPost ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        categoryPost(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    CategoryPut ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        categoryPut(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    CategoryDelete ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        categoryDelete(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    ProductGet ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        productGet(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    ProductPost ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        productPost(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    ProductPut ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        productPut(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    ProductDelete ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        productDelete(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    OrderGet ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        orderGet(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    OrderPut ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        orderPut(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    OrderStatusPut ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        orderStatusPut(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    OrderPostnoPut ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        orderPostnoPut(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    },
    orderDelete ({ state, commit, dispatch }, params) {
      return new Promise((resolve, reject) => {
        orderDelete(params).then(res => {
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    }
  }
}
export default shop
